import { baseRequest } from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/api/bizapp/biz/returnmaterial/${url}`, ...arg)

export default {
	getPage(data) {
		return request('page', data, 'get')
	},

	delete(data) {
		return request('delete', data, 'post')
	},

	addOrEdit(data) {
		if (data.id) {
			return request('edit', data, 'post')
		} else {
			return request('add', data, 'post')
		}
	},
	detail(data) {
		return request('detail', data, 'get')
	},
	approveRefuse(data) {
		return request('approveRefuse', data, 'post')
	},
	approvePass(data) {
		return request('approvePass', data, 'post')
	}
}
